import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:fluttertoast/fluttertoast.dart';

class ToastUtil {
  static show(text) {
    Fluttertoast.showToast(
        msg: text,
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.CENTER,
        // 消息框弹出的位置
        timeInSecForIosWeb: 1,
        // 消息框持续的时间（目前的版本只有ios有效）
        backgroundColor: Colors.black.withOpacity(0.6),
        textColor: Colors.white,
        fontSize: 16.0);
  }

  static toast(text) {
    EasyLoading.showToast(text, toastPosition: EasyLoadingToastPosition.bottom);
  }
}

